package Lesson;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class BWTest {
    public static void main(String[] args) {
        Writer w = null;
        BufferedWriter bw = null;

        try {
            w = new FileWriter("123.txt");
            bw = new BufferedWriter(w);

            bw.write("今天地震了");
            //换行
            bw.newLine();
            bw.write("成都有震感");

        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                bw.close();
                w.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    }
}
